home *** CD-ROM | disk | FTP | other *** search
/ Crosscountry USA Photo Safari / Crosscountry USA Photo Safari.iso / Data / cc_base / pak00_16bit_f.pk3 / timezone.tab.p < prev    next >
Text File  |  2003-01-03  |  8KB  |  228 lines

  1. {
  2.  
  3.   X = 601;
  4.   Y = 65;
  5.   state = 0;
  6.   rest_x = 601;
  7.   expand_x = 400;
  8.   Hidden = 1;
  9.   
  10.   ChildID = {
  11.     GuiLayer("timezone_layer") {
  12.       X = 0;
  13.       Y = 0;    
  14.       ChildID = {
  15.         GuiAnimation("plate") {
  16.           X = 39;
  17.           AnimationID = "gui/dash/tab/plate/plate.pcx";
  18.           Width = 240;
  19.           Height = 170;
  20.         },       
  21.             GuiTextInput("cur_timezone_label") {
  22.           X = 45;
  23.           Y = 10;
  24.           InputDisabled = TRUE;
  25.           Width = 120;
  26.           Height = 22;
  27.           FontID = "font/tab_w_on_g.tf";
  28.           ScriptID = Script {
  29.             @animate { 
  30.               ResPropSetStr(SELF,"InputText",MangleSIDToStr(245/*"Time Zone:"*/));
  31.             }
  32.           };
  33.         },
  34.             GuiTextInput("cur_timezone") {
  35.           X = 60;
  36.           Y = 25;
  37.           Width = 180;
  38.           Height = 22;
  39.           InputDisabled = TRUE;
  40.           FontID = "font/verdana_9.tf";
  41.           InputText = Mangle(342/*"player 1 name"*/);
  42.           ScriptID = Script {
  43.             @animate { 
  44.               resid Player;
  45.               resid Game;
  46.               resid city_data_id;
  47.               str timezone;
  48.               Game = ResByName("Game");
  49.               city_data_id  = ResPropGetResID(ResByName("CSVData"), "city_id");
  50.               Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
  51.               timezone = CSVGetStr(city_data_id,"timezone",CSVSearch(city_data_id,"name",ResPropGetStr(Player,"nav_cur_city")));
  52.               ResPropSetStr(SELF,"InputText",timezone);
  53.             }
  54.           };
  55.         },
  56.         GuiTextInput("cur_date_label") {
  57.           X = 45;
  58.           Y = 40;
  59.           Width = 120;
  60.           Height = 22;
  61.           InputDisabled = TRUE;
  62.           FontID = "font/tab_w_on_g.tf";
  63.           ScriptID = Script {
  64.             @animate { 
  65.               ResPropSetStr(SELF,"InputText",MangleSIDToStr(246/*"Date:"*/));
  66.             }
  67.           };
  68.         },
  69.         GuiTextInput("cur_date") {
  70.           X = 60;
  71.           Y = 55;
  72.           Width = 200;
  73.           Height = 22;
  74.           InputDisabled = TRUE;
  75.           FontID = "font/verdana_9.tf";
  76.           ScriptID = Script {
  77.             @animate { 
  78.               resid Player;
  79.               resid Game;
  80.               int time;
  81.               str dayofweek;
  82.               int day;
  83.               str month;
  84.               int year;
  85.               int time_zone_real_offset;
  86.               Game = ResByName("Game");
  87.               Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
  88.               
  89.               time  = ResPropGetInt(Player,"time_now");
  90.               time_zone_real_offset = ResPropGetInt(Player,"time_zone_real_offset");
  91.               time += (time_zone_real_offset * 60);              
  92.               dayofweek  = TimeGetWeekdayStr(time);
  93.               month = TimeGetMonthStr(time);
  94.               day = TimeGetDay(time);
  95.               year = TimeGetYear(time);
  96.               ResPropSetStr(SELF,"InputText",StrFormatStr("%s, %s %d, %d",StrCapFirst(dayofweek),StrCapFirst(month),day,year));
  97.             }
  98.           };
  99.         },
  100.         GuiTextInput("cur_time_label") {
  101.           X = 45;
  102.           Y = 70;
  103.           Width = 120;
  104.           Height = 22;
  105.           InputDisabled = TRUE;
  106.           FontID = "font/tab_w_on_g.tf";
  107.           ScriptID = Script {
  108.             @animate { 
  109.               ResPropSetStr(SELF,"InputText",MangleSIDToStr(247/*"Time:"*/));
  110.             }
  111.           };
  112.         },
  113.         GuiTextInput("cur_time") {
  114.           X = 60;
  115.           Y = 85;
  116.           Width = 200;
  117.           Height = 22;
  118.           InputDisabled = TRUE;
  119.           FontID = "font/verdana_9.tf";
  120.           ScriptID = Script {
  121.             @animate { 
  122.               resid Player;
  123.               resid Game;
  124.               int time;
  125.               int time_zone_real_offset;
  126.               str clock;
  127.  
  128.               Game = ResByName("Game");
  129.               Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
  130.               time  = ResPropGetInt(Player,"time_now");
  131.               time_zone_real_offset = ResPropGetInt(Player,"time_zone_real_offset");
  132.               time += (time_zone_real_offset * 60);
  133.               clock = TimeGetClock12Str (time);
  134.               ResPropSetStr(SELF,"InputText",clock);
  135.             }
  136.           };
  137.         },
  138.         GuiAnimation("line") {
  139.           AnimationID = "gui/dash/tab/line/line.pcx";
  140.           Y = 105;
  141.           X = 45;
  142.         },
  143.         GuiTextInput("notice") {
  144.           X = 45;
  145.           Y = 110;
  146.           Width = 180;
  147.           Height = 80;
  148.           WordWrap = TRUE;
  149.           InputDisabled = TRUE;
  150.           FontID = "font/tab_w_on_g.tf";
  151.           ScriptID = Script {
  152.             @animate {
  153.               resid Player;
  154.               resid Game;
  155.               int time;
  156.               str time_zone_real;
  157.               str time_zone_clock;
  158.               Game = ResByName("Game");
  159.               Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
  160.               time_zone_real = ResPropGetStr(Player,"time_zone_real");
  161.               time_zone_clock = ResPropGetStr(Player,"time_zone_clock");
  162.               if (StrExact(time_zone_real,time_zone_clock)) {
  163.                 ResPropSetStr(SELF,"InputText",MangleSIDToStr(248/*"Your clock is set to the proper time zone."*/));
  164.               } else {
  165.                 ResPropSetStr(SELF,"InputText",StrFormatStr(MangleSIDToStr(249/*"You have entered the %s zone. Adjust your clock."*/),time_zone_real));
  166.               }
  167.             }
  168.           };
  169.         }
  170.                
  171.       };
  172.     },
  173.     GuiAnimation("tab") {
  174.       Y = 10; 
  175.       AnimationID = "gui/dash/tab/timezone/timezone_off.pcx";
  176.       ScriptID = script {
  177.         @activate {
  178.           resid Parent;
  179.           resid Player;
  180.           resid Game;
  181.           Game = ResByName("Game");
  182.           Player = ResPropGetResID(ResByName("Game"),"game_cur_player");          
  183.           Parent = GuiParent(SELF);
  184.  
  185.           if ( ResPropGetResID(Player,"truck_tab_expanded") == Parent) {
  186.             ResPropSetResID(Player,"truck_tab_expanded",RES_INVALID);
  187.           } else {
  188.             ResPropSetResID(Player,"truck_tab_expanded",Parent);
  189.             GuiToFront(Parent);
  190.           }
  191.         }
  192.         @animate {
  193.           resid Parent;
  194.           int state;
  195.           resid Player;
  196.           resid Game;
  197.           int time;
  198.           str time_zone_real;
  199.           str time_zone_clock;
  200.          
  201.           Game = ResByName("Game");
  202.           Player = ResPropGetResID(ResByName("Game"),"game_cur_player");          
  203.           Parent = GuiParent(SELF);
  204.           
  205.           time_zone_real = ResPropGetStr(Player,"time_zone_real");
  206.           time_zone_clock = ResPropGetStr(Player,"time_zone_clock"); 
  207.           
  208.           if ( ResPropGetResID(Player,"truck_tab_expanded") == Parent) {
  209.             ResPropSetInt(Parent,"X",ResPropGetInt(Parent,"expand_x"));
  210.             ResPropSetInt(GuiSiblingByName("timezone_layer"),"Hidden",FALSE);
  211.           } else {
  212.             ResPropSetInt(GuiSiblingByName("timezone_layer"),"Hidden",TRUE);
  213.             ResPropSetInt(Parent,"X",ResPropGetInt(Parent,"rest_x"));
  214.           }
  215.  
  216.           if (StrExact(time_zone_real,time_zone_clock)) {
  217.             ResPropSetResID(SELF,"AnimationID",ResByName("gui/dash/tab/timezone/timezone_off.pcx"));
  218.           } else {
  219.             ResPropSetResID(SELF,"AnimationID",ResByName("gui/dash/tab/timezone/timezone_on.pcx"));
  220.           }
  221.  
  222.           
  223.         }
  224.       }
  225.       }
  226.   };
  227. }
  228.